package com.d3works.apps.hr.service.extra.hours;

import com.d3works.apps.hr.db.ExtraHours;
import com.d3works.apps.message.db.Message;
import com.d3works.exception.D3worksException;
import com.google.inject.persist.Transactional;
import java.io.IOException;
import javax.mail.MessagingException;
import wslite.json.JSONException;

public interface ExtraHoursService {

  @Transactional(rollbackOn = {Exception.class})
  public void cancel(ExtraHours extraHours) throws D3worksException;

  public Message sendCancellationEmail(ExtraHours extraHours)
      throws D3worksException, ClassNotFoundException, InstantiationException,
          IllegalAccessException, MessagingException, IOException, JSONException;

  @Transactional(rollbackOn = {Exception.class})
  public void confirm(ExtraHours extraHours) throws D3worksException;

  public Message sendConfirmationEmail(ExtraHours extraHours)
      throws D3worksException, ClassNotFoundException, InstantiationException,
          IllegalAccessException, MessagingException, IOException, JSONException;

  @Transactional(rollbackOn = {Exception.class})
  public void validate(ExtraHours extraHours) throws D3worksException;

  public Message sendValidationEmail(ExtraHours extraHours)
      throws D3worksException, ClassNotFoundException, InstantiationException,
          IllegalAccessException, MessagingException, IOException, JSONException;

  @Transactional(rollbackOn = {Exception.class})
  public void refuse(ExtraHours extraHours) throws D3worksException;

  public Message sendRefusalEmail(ExtraHours extraHours)
      throws D3worksException, ClassNotFoundException, InstantiationException,
          IllegalAccessException, MessagingException, IOException, JSONException;

  public void compute(ExtraHours extraHours);
}
